<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>YbCall API Test</title>
    <script src="jquery.min.js"></script>
    <script>
        $(document).ready(function() {
            $('#submitButton').click(function() {
                var userInput = $('#userInput').val();
				var host = $('#host').val();
                console.log(userInput);
                console.log(JSON.parse(userInput));
                $.ajax({
                    url: "http://"+host+':8088/api/ybcall',  // 更改为实际的API地址
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify(userInput),
                    success: function(response) {
                        $('#result').text('return val: ' + response);
                        console.log(response);
                        console.log(JSON.parse(response));
                    },
                    error: function(xhr, status, error) {
                        $('#result').text('Error: ' + xhr.responseText);
                        console.log(xhr.responseText);
                    }
                });
            });
        });
    </script>
</head>
<body>
    <h2>Test YbCall API</h2>
    <!--<input type="text" id="userInput" placeholder="Enter a string" />-->
	<input type="text" id="host"  placeholder="Enter your server ip,like 127.0.0.1" />
    <textarea rows="10" cols="200" id="userInput" placeholder="Enter your input json string,and click the call button below,you will get data from medical insurance center."></textarea><br/>
    <button id="submitButton">call</button>
    <p id="result"></p>
</body>
</html>